package com.hnl.util;

import com.hnl.core.AttachmentConfig;

public class FileUploadUtil {

	public static String GetFileRowString(String filename, String contentType,
			long filesize, String downloadUrl) {
		return new String("{\"name\":\"" + filename + "\",\"type\":\""
				+ contentType + "\",\"size\":\"" + filesize
				+ "\",\"downloadURL\":\"" + downloadUrl + "\"}");
	}

	public static String GetDownloadURL(String fileFullPath) {
		String backslash = System.getProperty("file.separator");
		return new String(fileFullPath.substring(AttachmentConfig.tomcatPath
				.length())).replace(backslash, "/");
	}
}